package com.m.polymorphic;

public class Income {
    protected Double income;

    public Income(Double income) {
        this.income = income;
    }

    public static Double totalIncome(Income... incomes){
        Double total = 0.0;
        for (Income income : incomes) {
            total+=income.getTex();
        }
        return total;
    }


    public Double getIncome() {
        return income;
    }

    public Double getTex(){
        return income*0.1;
    }
}
